home *** CD-ROM | disk | FTP | other *** search
/ Complete Linux / Complete Linux.iso / docs / apps / database / ingres04.lzh / source / parser / scanner.h < prev    next >
Encoding:
C/C++ Source or Header  |  1993-01-18  |  2.6 KB  |  103 lines

  1. /*
  2. **    SCANNER.H
  3. **    contains the global structures and variable declarations needed
  4. **    by the lexical analyzer.  This includes Manifest Constants and
  5. **    certain variables for internal communication purposes.  Therefore,
  6. **    extreme care should be exercised when modifying this file.
  7. **
  8. **    Version:
  9. **        @(#)scanner.h    8.2    2/8/85
  10. */
  11.  
  12.  
  13. /* MANIFEST CONSTANTS */
  14. # define    SBUFSIZ        2000    /* max size of symbol table for */
  15. # define    MAXSTRING    255    /* max length of strings */
  16. # define    GOVAL        -1    /* semantic value for command names */
  17.  
  18. # ifndef    WARN
  19. # define    WARN        0
  20. # define    FATAL        1
  21. # endif
  22.  
  23. /* CONSTANTS FOR THE GET_SCANNER CALL */
  24. # define    NORMAL        0    /* get a character from front */
  25. # define    PRIME        1    /* prime the front end */
  26. # define    SYNC        2    /* sync the front end */
  27.  
  28. /* CHARACTER TYPES */
  29. # define    ALPHA        1
  30. # define    NUMBR        2
  31. # define    OPATR        3
  32. # define    PUNCT        4
  33. # define    CNTRL        5
  34.  
  35. /* Modes for input from EQUEL front end */
  36. # define    CVAR_I2        '\1'    /* 2 byte integer */
  37. # define    CVAR_F8        '\4'    /* 8 byte floating number */
  38. # define    CVAR_S        '\3'    /* string with null byte */
  39. # define    CVAR_I4        '\6'    /* 4 byte integer */
  40.  
  41. /* Number of PAT_SPEC indices allowed.    */
  42. /* Already defined in ovqp.h.        */
  43. /* Temporarily defining here too.    */
  44. # define     PATNUM        10    
  45.  
  46. /* Bits used with Patspec_flag[] */
  47. # define     TARGBIT        1    /* Set when index used in target list */
  48. # define     QUALBIT        2    /* Set when index used in qual list */
  49.  
  50. /* KEYWORD and OPERATOR TABLE */
  51. struct optab                /* key word/operator tables */
  52. {
  53.     char    *term;            /* key word/operator body */
  54.     int    token;            /* associated parser token */
  55.     int    opcode;            /* associated parser opcode */
  56. };
  57.  
  58. /* SPECIAL TOKENS for scanner */
  59. struct special
  60. {
  61.     int    sconst;
  62.     int    bgncmnt;
  63.     int    endcmnt;
  64.     int    i2const;
  65.     int    i4const;
  66.     int    f4const;
  67.     int    f8const;
  68.     int    name;
  69. };
  70.  
  71. /* last token struct */
  72. struct lastok
  73. {
  74.     int    toktyp;
  75.     char    *tok;
  76.     int    tokop;
  77. };
  78.  
  79. /* declarations */
  80. struct special    Tokens;            /* special tokens table */
  81. struct optab    Optab[];        /* operator table */
  82. struct optab    Keyword[];        /* keyword table */
  83. struct lastok    Lastok;
  84. int        Opcode;            /* opcode for current token */
  85. int        Lcase;            /* UPPER->lower conversion flag */
  86. int        Pars;            /* flag for call to getcvar or not */
  87. int        Newline;        /* set if last char read was a newline */
  88. int        Cflag;            /* set if line of C-code recognized */
  89. int        Keyent;            /* number of entries in the Keyword table */
  90. extern unsigned    Patspec_flag[];        /* Flag array for determining correct */
  91.                     /* usage of PAT_SPEC indices.          */
  92.                     /* Patspec_flag[0] is not used.          */
  93.  
  94. extern char        Sbuf[];        /* symbol table buffer */
  95. /*
  96. **    TRACE FLAG ASSIGNMENTS
  97. **    Comment, Expand        70
  98. **    Name, String        71
  99. **    Number, Yylex        72
  100. **    Operator        73
  101. **    Inout            74
  102. */
  103.